From: Kim F. Storm Date: Fri, 13 Apr 2007 12:52:00 +0000 (+0000) Subject: (Fkill_buffer): gcpro BUF during kill_buffer_processes X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~900 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=17bcfd433a944fc37adf14dea4ee676926c2b5d8;p=emacs.git (Fkill_buffer): gcpro BUF during kill_buffer_processes and check that buffer is still alive upon return. --- diff --git a/src/buffer.c b/src/buffer.c index 3ad92331e01..ba23cc6ae33 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1458,7 +1458,16 @@ with SIGHUP. */) unlock_buffer (b); #endif /* CLASH_DETECTION */ + GCPRO1 (buf); kill_buffer_processes (buf); + UNGCPRO; + + /* Killing buffer processes may run sentinels which may + have called kill-buffer. */ + + if (NILP (b->name)) + return Qnil; + clear_charpos_cache (b); tem = Vinhibit_quit;